<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
<link href="../js/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="../laypage/skin/laypage.css" rel="stylesheet">
<!-- 可选的Bootstrap主题文件（一般不使用） -->
<script src="../js/bootstrap/css/bootstrap-theme.min.css"></script>
<link rel="stylesheet" type="text/css" href="../mycss/style.css" />
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script type="text/javascript" src="../laypage/laypage.js"></script>
<script src="../js/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>
<script src="heyun.js"></script>
<style type="text/css">
#menu {
	margin-left: 50%;
}
/* #menu .table{
     border: 0px solid transparent !important;
 } */
</style>
<script type="text/javascript">
	$(function() {
		getAllOppo(1);
	})
</script>
</head>
<body id="tablePage">
	<div>
		<blockquote>
			<p class="twoType">机会管理</p>
		</blockquote>
		<hr />
		 <form action=""  id="search">
		   <table class="table"> 
		    <tr>
		     <td>机会是否分配</td>
		     <td>
		      <input type="radio" name="chance" value="0"/>是 
		      <input type="radio" name="chance" value="1"/>否 
		     </td>
		    </tr>
		    <tr>
		    <td>机会名称</td>
		    <td><input type="text" name="chanceName" /></td>
		    </tr>
		    <tr>
		    <td colspan="2" style="text-align: center"><input type="button" value="开始查询" onclick="searchOppo(1)"/>  </td>
		    
		    </tr>
		   </table>    
		</form> 
		<div class="btnChange">
			<div id="menu">
				<table class="table">
					<tr>
						<td>
							<button class="btn btn-primary btn-lg" data-toggle="modal"
								data-target="#myModal" onclick="getDeptRole()">添加</button> <!-- 模态框（Modal） -->
							<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
								aria-labelledby="myModalLabel" aria-hidden="true">
								<div class="modal-dialog">
									<div class="modal-content">
										<div class="modal-header">
											<button type="button" class="close" data-dismiss="modal"
												aria-hidden="true">&times;</button>
											<h4 class="modal-title" id="myModalLabel">添加员工</h4>
										</div>
										<div class="modal-body">
											<form action="saveOppo" method="post" id="oppo">
												<table class="table" border="0">
													<tr>
														<td>机会名称</td>
														<td><input type="text" name="oppoName"></td>
													</tr>
													<tr>
														<td>机会类别</td>
														<td><select name="oppoType">
																<option selected="selected"></option>
																<option value="官网流量">官网流量</option>
																<option value="转介绍">转介绍</option>
																<option value="客户来访">客户来访</option>
																<option value="媒体进线">媒体进线</option>
														</select> <!--   <input type="radio" name="gender" value="男"/> 男
				                <input type="radio" name="gender" value="女" />女 -->
														</td>
													</tr>
													<tr>
														<td>机会内容</td>
														<td><textarea rows="10" cols="50" name="oppoContent"></textarea>
														</td>
													</tr>
													<tr>
														<td>机会备注</td>
														<td><textarea rows="10" cols="50" name="oppoRemarks"></textarea>
														</td>
													</tr>
												</table>
											</form>
										</div>
										<div class="modal-footer">
											<button type="button" class="btn btn-default"
												data-dismiss="modal">取消添加</button>
											<button type="button" class="btn btn-primary"
												onclick="saveOppo()">保存</button>
										</div>
									</div>
									<!-- /.modal-content -->
								</div>
								<!-- /.modal -->
							</div>
						</td>
						<!--   <td>
  <button class="btn btn-default btn-lg"  onclick="updateState()">
	启用/停用
 </button>
    </td> -->
						<td>
							<button class="btn btn-warning btn-lg" data-toggle="modal"
								data-target="#myModal1" onclick="getOppoMessage()">修改</button> <!-- 模态框（Modal） -->
							<div class="modal fade" id="myModal1" tabindex="-1" role="dialog"
								aria-labelledby="myModalLabel" aria-hidden="true">
								<div class="modal-dialog">
									<div class="modal-content">
										<div class="modal-header">
											<button type="button" class="close" data-dismiss="modal"
												aria-hidden="true">&times;</button>
											<h4 class="modal-title" id="myModalLabel">员工修改</h4>
										</div>
										<div class="modal-body">
											<form action="saveEmp" method="post" id="oppoMessage">
												<table class="table" border="0">
													<tr>
														<td>机会编号</td>
														<td><input type="text" name="oppoManageId"
															readonly="readonly" id="oppoManageId" /></td>
													</tr>
													<tr>
														<td>机会名称</td>
														<td><input type="text" name="oppoName" id="oppoName"></td>
													</tr>
													<tr>
														<td>机会类别</td>
														<td><select name="oppoType" id="oppoType">
																<option selected="selected"></option>
																<option value="官网流量">官网流量</option>
																<option value="转介绍">转介绍</option>
																<option value="客户来访">客户来访</option>
																<option value="媒体进线">媒体进线</option>
														</select></td>
													</tr>
													<tr>
														<td>机会内容</td>
														<td><textarea rows="10" cols="50" name="oppoContent"
																id="oppoContent"></textarea></td>
													</tr>
													<tr>
														<td>机会备注</td>
														<td><textarea rows="10" cols="50" name="oppoRemarks"
																id="oppoRemarks"></textarea></td>
													</tr>
												</table>
											</form>
										</div>
										<div class="modal-footer">
											<button type="button" class="btn btn-default"
												data-dismiss="modal">取消修改</button>
											<button type="button" class="btn btn-primary"
												onclick="updateOppo()">保存</button>
										</div>
									</div>
									<!-- /.modal-content -->
								</div>
								<!-- /.modal -->
							</div>
						</td>

						<c:if test="${user.roleId !=4 and user.roleId !=6}">
							<td>
								<button class="btn btn-default btn-lg" onclick="deleteOppo()">
									删除
								</button>
							</td>
							<td>
								<button class="btn btn-warning btn-lg" data-toggle="modal"
									data-target="#myModalGive" onclick="getOppoEmp(1)">分配</button> <!-- 模态框（Modal） -->
								<div class="modal fade" id="myModalGive" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
									<div class="modal-dialog">
										<div class="modal-content">
											<div class="modal-header">
												<button type="button" class="close" data-dismiss="modal"
													aria-hidden="true">&times;</button>
												<h4 class="modal-title" id="myModalLabel">机会分配</h4>
											</div>
											<div class="modal-body">
												<form action="saveRole" method="post" id="deptMessage">
													<table class="table" border="0">
														<tr>
															<td>机会名称</td>
															<td><p id="oppoName1"></p></td>
														</tr>
														<tr>
															<td>机会类别</td>
															<td>
															<p id="oppoType1"></p>
															</td>
														</tr>
														<tr>
															<td>机会内容</td>
															<td>
															<p id="oppoContent1"></p>
															</td>
														</tr>
														<tr>
															<td>机会备注</td>
															<td>
															<p id="oppoRemarks1"></p>
															</td>
														</tr>
													</table>
												</form>
					<table id="empList" class="table table-bordered">
					<tr>
					<td></td>
					<td></td>
					<td>员工姓名</td>
					<td>性别</td>
					<td>所在部门</td>
                    <td>角色</td>
                    <td>入职时间</td>
					 </tr>
				     </table>	
											</div>
											<div class="modal-footer">
												<button type="button" class="btn btn-default"
													data-dismiss="modal">取消添加</button>
												<button type="button" class="btn btn-primary"
													onclick="giveOppo()">保存</button>
											</div>
										</div>
										<!-- /.modal-content -->
									</div>
									<!-- /.modal -->
								</div>
							</td>
						</c:if>
					</tr>
				</table>
			</div>
		</div>
		<div class="tableDiv">
			<form action="" id="roleTable">
				<table id="conTable" class="table table-bordered">
					<tr class="info">
						<td></td>
						<td></td>
						<td>机会名称</td>
						<td>机会类型</td>
						<td>录入时间</td>
						<td>录入人</td>
						<td>机会分配到人员</td>
					</tr>
					<!-- <tfoot><tr style="border:0px"><td><div id="page"></div></td></tr></tfoot> -->
				</table>
			</form>
		</div>        
	</div>
</body>
</html>